﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace zichan.BLL.StatisticsModel
{
    public class OldServerModel
    {
        #region //添加资产
       
        [Required(ErrorMessage = "资产名称不为空")]
        public string Name { get; set; }
        [Required(ErrorMessage = "资产类型不能为空")]
        public int AssetClassId { get; set; }
        [NotMapped]
        public string AssetClassName { get; set; }
        [Required(ErrorMessage = "所属公司不能为空")]
        public int CompanyId { get; set; }
        [NotMapped]
        public string CompanyName { get; set; }
        //[Required(ErrorMessage = "资产数量不为空")]
        //[RegularExpression(@"^\+?[1-9]\d*$", ErrorMessage = "只能输入正数")]
        //public int Number { get; set; }
        
        //public int BuyerId { get; set; }
        [Required(ErrorMessage = "采购人不为空")]
        public string BuyerName { get; set; }
        [Required(ErrorMessage = "采购时间不能为空")]
        //[RegularExpression(@"([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8])))", ErrorMessage = "请输入正确的时间格式，如：2016-01-01")]
        [RegularExpression(@"^(\d{4})/(\d{1}|1[0-2])/(\d{1}|[12]\d{1}|3[01])((\s\d{1}|1\d{1}|2[0-3]):[0-5]\d{1}:([0-5]\d{1}))?$", ErrorMessage = "请输入正确的时间格式，如：2016/1/1")]
        public DateTime BuyTime { get; set; }
        [Required(ErrorMessage = "接收人不能为空")]
        public string RecipientName { get; set; }
        public DateTime UploadTime { get; set; }
        /// <summary>
        /// 资产编码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 接收地
        /// </summary>
        public string CalculatedGround { get; set; }
        /// <summary>
        /// 供应商
        /// </summary>
        public string Supplier { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
       // public string Remark { get; set; }
        /// <summary>
        /// 状态
        /// 0、库存
        /// 1、使用中
        /// 2、报废
        /// </summary>
        public int Status { get; set; }
        public DateTime? ScrapTime { get; set; }
        /// <summary>
        /// 入库回收备注
        /// </summary>
        public string RecoveryRemark { get; set; }
        /// <summary>
        /// 出库备注
        /// </summary>
        public string DistributionRemark { get; set; }
        /// <summary>
        /// 报废备注
        /// </summary>
        public string ScrapRemark { get; set; }
        /// <summary>
        /// 服务器用途
        /// </summary>
        [Required(ErrorMessage = "服务器用途不能为空")]
        public int serverPurposeId { get; set; }

        [NotMapped]
        public string serverPurposeName { get; set; }
        /// <summary>
        /// 服务器用途类别
        /// </summary>
        [Required(ErrorMessage = "服务器用途类别不能为空")]
        public int? serverPurposeSubId { get; set; }
        [NotMapped]
        public string serverPurposeSubName { get; set; }
        //public int UserId { get; set; }
        [Required(ErrorMessage = "使用人不能为空")]
        public string UserName { get; set; }
        /// <summary>
        ///专用于服务器资产标识
        /// </summary>
       
        public string Identitys { get; set; }
       

        #endregion

        #region //完善信息
        
        [Required(ErrorMessage = "品牌不能为空")]
        public string Brand { get; set; }
        [Required(ErrorMessage = "型号不能为空")]
        public string Version { get; set; }
        [Required(ErrorMessage = "序列号不能为空")]
        public string SerialNumber { get; set; }
        [Required(ErrorMessage = "U数不能为空")]
        [RegularExpression(@"^\+?[1-9]\d*$", ErrorMessage = "必须大于0")]
        public int U_Number { get; set; }
        [Required(ErrorMessage = "CPU必填")]
        public string CPU { get; set; }
        [Required(ErrorMessage = "内存必填")]
        public string Memory { get; set; }
        [Required(ErrorMessage = "硬盘必填")]
        public string HardDisk { get; set; }
        [Required(ErrorMessage = "RAID卡不能为空")]
        public string HardWareRAID { get; set; }
        [Required(ErrorMessage = "网口必填")]
        public string Comb { get; set; }
        [Required(ErrorMessage = "出厂时间必填")]
        [RegularExpression(@"^(\d{4})/(\d{1}|1[0-2])/(\d{1}|[12]\d{1}|3[01])((\s\d{1}|1\d{1}|2[0-3]):[0-5]\d{1}:([0-5]\d{1}))?$", ErrorMessage = "请输入正确的时间格式，如：2016/1/1")]
        public DateTime DeliveryTime { get; set; }
        [Required(ErrorMessage = "过保时间必填")]
        [RegularExpression(@"^(\d{4})/(\d{1}|1[0-2])/(\d{1}|[12]\d{1}|3[01])((\s\d{1}|1\d{1}|2[0-3]):[0-5]\d{1}:([0-5]\d{1}))?$", ErrorMessage = "请输入正确的时间格式，如：2016/1/1")]
        public DateTime WarrantyTime { get; set; }
        /// <summary>
        ///管理员
        /// </summary>
        public int? AdminiStratorId { get; set; }
        public string AdminiStratorName { get; set; }
        #endregion

        #region //服务器上架
        [Required(ErrorMessage = "机房不能为空")]
        public int MachineRoomId { get; set; }
        [NotMapped]
        public string MachineRoomName { get; set; }
        [Required(ErrorMessage = "机柜不能为空")]
        public int CabinetId { get; set; }
        [NotMapped]
        public string CabinetName { get; set; }
        /// <summary>
        /// 标准机架数
        /// </summary>
        [NotMapped]
        public int StandardNumber { get; set; }
        /// <summary>
        /// 剩余机架数
        /// </summary>
        //[NotMapped]
        //public int Surplus { get; set; }
        [Required(ErrorMessage = "用途不能为空")]
        public int PurposeId { get; set; }
        [NotMapped]
        public string PurposeName { get; set; }
        //[Required(ErrorMessage = "占位不能为空")]
        //[RegularExpression(@"^\+?[1-9]\d*$", ErrorMessage = "占位必须大于0")]
        //public int UseNumber { get; set; }
        [Required(ErrorMessage = "IP不能为空")]
        public int IPId { get; set; }
        [NotMapped]
        public string IP { get; set; }
        public string SubIPIds { get; set; }
        [NotMapped]
        public string SubIP { get; set; }
        [NotMapped]
        public string[] SubIPId { get; set; }
        /// <summary>
        /// 内网ip
        /// </summary>
        public string IntranetIP { get; set; }
        /// <summary>
        /// 是否反解
        /// </summary>
        public bool IsInverse { get; set; }
        /// <summary>
        /// 上架备注
        /// </summary>
       // public string Remark { get; set; }
        /// <summary>
        /// 下架备注
        /// </summary>
        public string RemoveRemark { get; set; }
        /// <summary>
        /// 空位/剩余机架数
        /// </summary>
        //[Required(ErrorMessage ="机架位未显示，请稍候")]
        public int? Vacancy { get; set; }
        public int Statu { get; set; }
        [NotMapped]
        public string StatuName { get; set; }
        public DateTime putAwayTime { get; set; }
        public DateTime CabinetUploadTime { get; set; }
        /// <summary>
        /// 0为无产权，1为有产权
        /// </summary>
        //public int? Equity { get; set; }
        /// <summary>
        /// 有值，则为该机柜架被使用过，只能报废
        /// </summary>
        public int? IsUsed { get; set; }
        /// <summary>
        /// 租用产权
        /// </summary>
        public string Property { get; set; }
        /// <summary>
        /// 托管产权
        /// </summary>
        public string TProperty { get; set; }
        #endregion
    }
}
